import java.util.ArrayList;
import java.util.HashMap;


public class QLearningTester {

	public static void main(String[] args) {
		HashMap<StateAction, Double> testQ = new HashMap<StateAction, Double>();
		State testState = new State();
		testState.numberOfTransmittedChannels = 4;
		Environment env = new Environment(8);
		
		Action acquire = Action.ACQUIRE;
		Action drop = Action.DROP;
		Action nothing = Action.NOTHING;
		Node randomNode = new Node("random");
		randomNode.environment = env;
		randomNode.acquiredChannels = new ArrayList<Channel>();
		randomNode.acquiredChannels.add(new Channel("1"));
		randomNode.acquiredChannels.add(new Channel("2"));
		randomNode.acquiredChannels.add(new Channel("3"));
		randomNode.acquiredChannels.add(new Channel("4"));
		
		randomNode.currentState= testState;
		randomNode.currentState = randomNode.conductAction(randomNode.currentState, drop);
		
		StateAction acquireStateAction = new StateAction(new State(testState), acquire);	// 
		StateAction dropStateAction = new StateAction(new State(testState), drop);
		StateAction nothingStateAction = new StateAction(new State(testState), nothing);
		
		testQ.put(acquireStateAction, 40.0);
		testQ.put(nothingStateAction, 30.0);
		testQ.put(dropStateAction, 25.0);
		
		Node testNode = new Node("test node");
		testNode.Q = testQ;
		testNode.printQ();
		
		Action bestAction = testNode.getBestAction(testState);
		System.out.println(bestAction);
	}	
	
}